package com.example.project.common;

import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;

/**
 * 全类名, 反射辅助类
 **/
@Component
public class ClassUtils {
    private static Map<String, String> map;

    @PostConstruct
    public void init() {
        map = new HashMap<String, String>(){{
            put("string", String.class.getName());
            put("byte", byte.class.getName());
            put("short", short.class.getName());
            put("int", int.class.getName());
            put("long", long.class.getName());
            put("float", float.class.getName());
            put("double", double.class.getName());
            put("boolean", boolean.class.getName());
            put("char", char.class.getName());
        }};
    }
    public static String getPath(String classPath) {
        return map.getOrDefault(classPath, classPath);
    }

}
